<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta title="template local_template.html">
<title>Pygment-based styling Tests</title>
</head>
<body>
<div id="main_title">Pygment-based styling</div>
<div id='content'>
<div class="notes">
In this file, we make use of the <code title="py">"show_vlam"</code> option
to automatically reveal what options we used to style the code just below it.
</div>

<p>If you have throught the user preference page, you may have read that
Crunchy uses <a title="external_link" href="http://pygments.org">Pygments</a> to style code.
To help you choose a given style, we provide you with a few code samples on this page to
see the result of your choice.</p>
<p>If you are a tutorial writer
(or if you used the advanced options to override Crunchy's defaults),
you might be interested to learn that, to specify a language,
Crunchy uses the same convention that is used by Pygment as given on
<a title="external_link" href="http://pygments.org/docs/lexers/">Pygments available Lexers</a>,
with a few other "obvious" choices as alternative options.
</p>
<p>
For example, a Python code sample can be styled using either:
</p>
<pre title="PythonLexer show_vlam">
print "Hello World!"
</pre>
<p>
or
</p>
<pre title="python show_vlam">
print "Hello World!"
</pre>
<p>
or
</p>
<pre title="py show_vlam">
Andr&eacute; = "my name"  # note the syntax error
print "Hello World!"
</pre>
<pre title="python3 show_vlam">
# Identifiers with non-ascii characters are ok with Python 3!
Andr&eacute; = "my name"
print "Hello World!"
</pre>

<p>You can select the desired style here and reload the page to see its effect.</p>
<div title="preferences style">pygments css class</div>

<p>As further simple tests, we style  some Python code with an embedded
<code title='html'>&lt;br/&gt;</code> to complicate things.</p>
<pre title="python">
print "Hello World!"<br/>print "Done!"
</pre>
<p>Next, some html code.</p>
<pre title="html show_vlam">
&lt;pre title="html"&gt;
</pre>
<p>We end this with a fairly complete example showing the various styling
that can take place for some Python code.</p>

<pre title="python show_vlam">
# some comment
'''A multi-
line comment
'''
import this
import sys

import my_module as something_else

class New(object):
    """a docstring"""
    def __init__(self, a, b=[], c={}):
        self.a = a
        self.b = b  # a comment
        return None

    def other(self, choice):
        """ a multi
            line
            docstring
        """
        pass

print "Hello world!"
for i in range(42):
   print i,

if __name__ == "__main__":
   n = New(3)
</pre>

</div>
</body>
</html>